import { App } from 'vue'
import SvgIcon from '@/components/SvgIcon/index.vue'

/* 使用require.context 加载所有的svg */
const req = require.context('./svg', false, /\.svg$/),
  requireAll = (requireContext: ReturnType<typeof require.context>) => requireContext.keys().map(requireContext)
requireAll(req)

export default (app: App) => {
  app.component('svg-icon', SvgIcon)
}
